#!/bin/bash

PIDPATH='/tmp'

if [ $# -eq 1 ];then
	cmd="kill $1"
else
	cmd="kill -SIGKILL"
fi

for pidfile in $PIDPATH/*.pid
do
	pid=$(cat $pidfile)
	cmd="$cmd $pid"
done

$cmd
